package com.amos.muexamclient.sys.service.dto;


import com.alibaba.fastjson.JSONObject;
import com.amos.core.PageDTO;
import com.amos.muexamclient.sys.entity.SysDeptEntity;
import com.amos.muexamcore.core.MuEntity;
import com.amos.muexamcore.core.MuField;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Copyright © 2018 五月工作室. All rights reserved.
 *
 * @Package com.amos.muexamclient.service.dto
 * @ClassName SysDeptDTO
 * @Description TODO
 * @Author Amos
 * @Modifier
 * @Date 2020-03-15 10:39:17
 * @Version 1.0
 **/
@MuEntity(table = "sys_dept", entity = SysDeptEntity.class)
@Data
public class SysDeptDTO extends PageDTO implements Serializable {

    private static final long serialVersionUID = 9198618796148534980L;
    @MuField(remark = "父部门id", type = "varchar", length = 32, column = "parent_id")
    private String parentId;

    @MuField(remark = "祖级列表", type = "varchar", length = 50, column = "ancestors")
    private String ancestors;

    @MuField(remark = "部门名称", type = "varchar", length = 30, column = "dept_name")
    private String deptName;

    @MuField(remark = "显示顺序", type = "int", column = "order_num")
    private String orderNum;

    @MuField(remark = "负责人", type = "varchar", length = 20, column = "leader")
    private String leader;

    @MuField(remark = "联系电话", type = "varchar", length = 11, column = "phone")
    private String phone;

    @MuField(remark = "邮箱", type = "varchar", length = 50, column = "email")
    private String email;

    @MuField(remark = "部门状态（0正常 1停用）", type = "tinyint", column = "status")
    private Boolean status;

    @MuField(remark = "删除标志（0代表存在 2代表删除）", type = "tinyint", column = "del_flag")
    private Boolean delFlag;

    @MuField(remark = "创建者", type = "varchar", length = 64, column = "create_by")
    private String createBy;

    @MuField(remark = "更新者", type = "varchar", length = 64, column = "update_by")
    private String updateBy;

    @MuField(remark = "更新时间", type = "datetime", column = "update_time")
    private Date updateTime;

    private List<SysDeptDTO> children;


    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
